import { parse } from './parse';
import { generate } from './generate'
export function compilerToFunction(template) {
    // 生成ast语法树
    const ast = parse(template.trim());
    // 生成代码
    const code = generate(ast);
    let render = new Function(`with(this) {
        return ${code.trim()}
    }`);
    return render;
}

